function HandleUsers(gui, user, date, options, message) {
  this._gui = gui;
  this._user = user;
  this._date = date;
  this._options = options;
  this._message = message;

  this._createElements();
};

HandleUsers.prototype._createElements = function() {
  MClientUtils.countIt(new RequestUtils());
  
  var users = (this._message[0]) ? this._message[0].data : [];
  
  this._gui.add.onclick = function() { location.href = '?t=user'; }
  
  var tr, td, a, _self = this;
  DOMUtils.removeTableRows(this._gui.result, 1);
  
  for (var i = 0, il = users.length; i < il; i++) {
    var tmp = users[i];
    
    tr = this._gui.result.insertRow(-1);
    tr.style.backgroundColor = (tr.rowIndex % 2 == 0) ? '#ececec' : '#fff';
    td = tr.insertCell(-1);
    td.style.height = '24px';
    td.style.textAlign = 'left';
    td.style.borderRight = 'solid 1px #bbb';
    
    a = document.createElement('a');
    a.href = '?t=user&i=' + tmp.id;
    a.appendChild(document.createTextNode((tmp.account == '') ?  '-' : tmp.account));
    td.appendChild(a);
    
    td = tr.insertCell(-1);
    td.style.borderRight = 'solid 1px #bbb';
    td.appendChild(document.createTextNode(tmp.type));
    
    td = tr.insertCell(-1);
    td.style.borderRight = 'solid 1px #bbb';
    td.appendChild(document.createTextNode(tmp.email));
    
    td = tr.insertCell(-1);
    var remv;
    remv = document.createElement('img');
    remv.style.padding = "0 0 2px 0";
    remv.style.cursor = 'pointer';
    remv.src = 'image/delete.png';
    remv._user = tmp;
    remv.onclick = function() { new RequestUtils()._write(JSON.stringify([{ n: 'pz_user', a: [], r: [this._user] }]), function(result, params) { location.reload(); }, { pos: DOMUtils.findPos(this) }); };
    td.appendChild(remv);
  }
  if (users.length == 0) {
    tr = this._gui.result.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan = 11;
    td.style.padding = '10px 0 10px 30px';
    td.style.color = '#ff0000';
    td.style.fontWeight = 'bold';
    td.appendChild(document.createTextNode('No Records Found'));
  }
};
